package com.ea.admin.permission;

import lombok.Getter;

@Getter
public enum PermissionCode {
    ADMIN_MANAGE(10000, null, "管理员管理"),
    ADD_ADMIN(10001, ADMIN_MANAGE, "添加管理员"),
    EDIT_ADMIN(10002, ADMIN_MANAGE, "编辑管理员"),
    DELETE_ADMIN(10003, ADMIN_MANAGE, "删除管理员"),
    BLOCK_ADMIN(10004, ADMIN_MANAGE, "禁用管理员"),
    EDIT_ADMIN_PASSWORD(10005, ADMIN_MANAGE, "修改管理员密码"),
    EDIT_ADMIN_FUNCTION_PERMISSION(10011, ADMIN_MANAGE, "修改管理员功能权限"),
    EDIT_ADMIN_COMPANY_PERMISSION(10012, ADMIN_MANAGE, "修改管理员单位权限"),
    EDIT_ADMIN_DEPT_PERMISSION(10013, ADMIN_MANAGE, "修改管理员部门权限"),

    COMPANY_MANAGE(20000, null, "单位管理"),
    ADD_COMPANY(20001, COMPANY_MANAGE, "添加单位"),
    EDIT_COMPANY(20002, COMPANY_MANAGE, "编辑单位"),
    DELETE_COMPANY(20003, COMPANY_MANAGE, "删除单位"),

    DEPT_MANAGE(30000, null, "部门管理"),
    ADD_DEPT(30001, DEPT_MANAGE, "添加部门"),
    EDIT_DEPT(30002, DEPT_MANAGE, "编辑部门"),
    DELETE_DEPT(30003, DEPT_MANAGE, "删除部门"),

    POSITION_MANAGE(40000, null, "职位管理"),
    ADD_POSITION(40001, POSITION_MANAGE, "添加职位"),
    EDIT_POSITION(40002, POSITION_MANAGE, "编辑职位"),
    DELETE_POSITION(40003, POSITION_MANAGE, "删除职位"),

    USER_MANAGE(50000, null, "人员管理"),
    ADD_USER(50001, USER_MANAGE, "添加人员"),
    EDIT_USER(50002, USER_MANAGE, "编辑人员"),
    DELETE_USER(50003, USER_MANAGE, "删除人员"),

    CONF_MANAGE(60000, null, "单位配置管理"),
    EDIT_CONF(60001, CONF_MANAGE, "修改单位的配置"),

    SUPER_MANAGE(100000, null, "超级管理员权限"),
    SUPER_OPERATE_LOG(100001, SUPER_MANAGE, "查看操作日志"),
    SUPER_ADD_ADMIN(100002, SUPER_MANAGE, "添加一级单位的超级管理员"),
    SUPER_ADD_COMPANY(100021, SUPER_MANAGE, "添加一级单位"),
    SUPER_EDIT_COMPANY(100022, SUPER_MANAGE, "编辑一级单位"),
    SUPER_EDIT_DEFAULT_CONF(100023, SUPER_MANAGE, "修改系统的默认配置"),
    SUPER_EDIT_DEFAULT_ROLE_FUNCTION(100024, SUPER_MANAGE, "修改系统的默认功能权限"),
    SUPER_EDIT_DATABASE_URL(100025, SUPER_MANAGE, "修改数据库连接"),
    SUPER_BACK_UP_DATABASE(100026, SUPER_MANAGE, "备份数据库"),
    SUPER_RECOVER_DATABASE(100027, SUPER_MANAGE, "恢复数据库"),

    // 数据源管理权限
    DATA_SOURCE_MANAGE(70000, null, "数据源管理"),
    ADD_DATA_SOURCE(70001, DATA_SOURCE_MANAGE, "添加数据源"),
    EDIT_DATA_SOURCE(70002, DATA_SOURCE_MANAGE, "编辑数据源"),
    DELETE_DATA_SOURCE(70003, DATA_SOURCE_MANAGE, "删除数据源"),
    ;

    private final Integer code;
    private final PermissionCode supCode;
    private final String name;

    PermissionCode(Integer code, PermissionCode supCode, String name) {
        this.code = code;
        this.supCode = supCode;
        this.name = name;
    }

}
